<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQiiLanguageLangTable extends Migration
{
    /**
     * Schema table name to migrate
     * @var string
     */
    public $set_schema_table = 'qii_language_lang';

    /**
     * Run the migrations.
     * @table qii_language_lang
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable($this->set_schema_table)) return;
        Schema::create($this->set_schema_table, function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->increments('lang_id')->comment('系统语言ID');
            $table->unsignedSmallInteger('language')->default('0')->comment('语种id');
            $table->unsignedSmallInteger('script')->default('0')->comment('录入方式');
            $table->unsignedSmallInteger('region')->default('0')->comment('语言地区');
            $table->unsignedSmallInteger('variant')->default('0')->comment('variant');
            $table->unsignedSmallInteger('extension')->default('0')->comment('extension');
            $table->unsignedSmallInteger('privateuse')->default('0')->comment('privateuse');
            $table->unsignedTinyInteger('status')->default('2')->comment('1:启用|2:禁用');
            $table->unsignedTinyInteger('lang_default')->default('2')->comment('前台默认语言 1:默认|2:非默认');
            $table->unsignedTinyInteger('admin_default')->default('2')->comment('后台默认语言 1:默认|2:非默认');
            $table->unsignedInteger('modified_date')->default('0')->comment('修改时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
     public function down()
     {
       Schema::dropIfExists($this->set_schema_table);
     }
}
